<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/include/include.jsp"%>
<script type="text/javascript">
$(document).ready(function(){
	$("#paginationDiv").harrypag({
		url:"business_card_ajax_list.do",
		data:{pageSize: 20, pageNo: 1},
		success:function(dataList){
			var objStr = "";
			var cl = "";
			$.each(dataList, function(i,data){
				if(i%2==0){cl="class='double'"}else{cl=""}
				objStr=objStr+"<tr "+cl+"><td class='ckbox'><input type=checkbox id='"+data.id+"'/></td>";
	     		objStr=objStr+"<td class='name'>"+data.cardname+"</td>";
	     		objStr=objStr+"<td class='mobilephone'>"+data.mobilephone+"</td>";
	     		objStr=objStr+"<td class='sex'>"+data.sex+"</td>";
	     		objStr=objStr+"<td class='birthday'>"+data.birthday+"</td>";
	     		objStr=objStr+"<td class='mail'>"+data.mail+"</td>";
	     		objStr=objStr+"<td>"+data.address+"</td>";
	     		objStr=objStr+"</tr>";
	     	});
	     	if(objStr == ""){objStr="<tr><td colspan=7 style='background:none;height:50px;color:#666'>当前无数据</td></tr>"}
		    $("#datalistTbody").html(objStr);
		},
		searchBtn:"submitSearch${info.srdm}",  //searchBtn
		searchParam:{"searchitem": "searchitem", "searchparam": "searchparam","cardgroup":"currentGroupId"}  //search params,{paramname, Element ID}
	});
	$("#submitSearch${info.srdm}").click(function(){
		$("#datalistTbody").html("<tr><td colspan=7 style='background:none;height:50px'><img src='images/base/loading.gif'/></td></tr>");
	});
	$("#searchAllCard").click(function(){
		$("#datalistTbody").html("<tr><td colspan=7 style='background:none;height:50px'><img src='images/base/loading.gif'/></td></tr>");
	});
});
function searchAllCard(){
	$("#searchparam").val("");
	$("#submitSearch${info.srdm}").click();
}
</script>
<div id="current108">
	<div class="cur_left"></div>
	<div class="cur_main108">
		<div id="currentBox">当前位置 -&gt; ${info.current}<input type="hidden" id="currentGroupId" value="${info.currentGroupId}"/></div>
		<div id="controlPanel">
			<table  border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td><a class="whitebtn" href="javascript:newCard();">添加名片</a></td>
					<td><a class="whitebtn" href="javascript:deleteCard();">删除所选</a></td>
					<c:if test="${info.currentGroupId != null && info.currentGroupId != 'nullgroup'}"><td><a class="whitebtn" href="javascript:deleteCardGroup();">删除本组</a></td></c:if>
					<td><a class="whitebtn" href="javascript:newCardGroup();">添加分组</a></td>
					<td><a class="whitebtn" href="javascript:void(0);">导入名片</a></td>
					<td><a class="whitebtn" href="javascript:void(0);">导出名片</a></td>
					<td><a class="whitebtn" href="javascript:editCard();">名片设置</a></td>
				</tr>
				<tr>
					<td><select id="searchitem"><option value="name">姓名</option><option value="mobilephone">手机</option></select></td>
					<td colspan=2><input id="searchparam"/></td>
					<td><a class="bluebtn" href="javascript:void(0);" id="submitSearch${info.srdm}">查找</a></td>
					<td><a class="bluebtn" href="javascript:searchAllCard();" id="searchAllCard">全部</a></td>
					<td colspan=2></td>
				</tr>
			</table>
		</div>
	</div>
</div>
<div id="mainBox108">
	<div>
		<table class="datalistTable" border="0" cellspacing="0" cellpadding="0">
			<thead>
				<tr>
					<th class='ckbox'></th>
					<th class='name'>姓名</th>
					<th class='mobile'>手机</th>
					<th class='sex'>性别</th>
					<th class='birthday'>生日</th>
					<th class='mail'>E-mail</th>
					<th>地址</th>
				</tr>
			</thead>
			<tbody id="datalistTbody">
				<tr><td colspan=7 style="background:none;height:50px"><img src='images/base/loading.gif'/></td></tr>
			</tbody>
		</table>
	</div>
</div>
<div id="pag">
	<div class="pag_left"></div>
	<div class="pag_main">
		<div id="pagBox"><div id="paginationDiv"></div></div>
	</div>
</div>